package com.mmy.controller.sys;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.mmy.domain.sys.VSysAddress;
import com.mmy.domain.sys.VSysUser;
import com.mmy.service.car.impl.TCarOrderServiceImpl;
import com.mmy.service.impl.hotel.THotelOrderServiceImpl;
import com.mmy.service.impl.line.LineOrderServiceImpl;
import com.mmy.service.impl.restaurant.TRestaurantOrderServiceImpl;
import com.mmy.service.impl.sys.VSysAddressServiceImpl;
import com.mmy.service.impl.sys.VSysUserServiceImpl;
import com.mmy.service.impl.visa.TVisaOrderServiceImpl;
import com.mmy.service.permissionmenu.impl.PermissionServiceImpl;
import com.mmy.service.permissionmenu.impl.UserPermissionServiceImpl;
import com.mmy.service.plane.impl.TPlaneOrderServiceImpl;
import com.mmy.service.scenic.impl.TScenicOrderServiceImpl;
import com.mmy.service.ship.impl.TShipOrderServiceImpl;
import com.mmy.service.train.impl.TrainOrderServiceImpl;

/**
 * 类的介绍：控制层 登录注册
 *
 * @author
 * @date 创建日期
 * @version 1.0
 */

@Controller
public class VSysUserController {
	@Autowired
	VSysUserServiceImpl vSysUserServiceImpl;
	@Autowired
	VSysAddressServiceImpl vSysAddressServiceImpl;
	@Autowired
	PermissionServiceImpl permissionServiceImpl;
	@Autowired
	UserPermissionServiceImpl userPermissionServiceImpl;
	@Autowired
	TScenicOrderServiceImpl tScenicOrderServiceImpl;
	@Autowired
	LineOrderServiceImpl lineOrderServiceImpl;
	@Autowired
	THotelOrderServiceImpl tHotelOrderServiceImpl;
	@Autowired
	TRestaurantOrderServiceImpl tRestaurantOrderServiceImpl;
	@Autowired
	TCarOrderServiceImpl tCarOrderServiceImpl;
	@Autowired
	TrainOrderServiceImpl TrainOrderServiceImpl;
	@Autowired
	TPlaneOrderServiceImpl tPlaneOrderServiceImpl;
	@Autowired
	TShipOrderServiceImpl tShipOrderServiceImpl;

	@Autowired
	TVisaOrderServiceImpl tVisaOrderServiceImpl;

	/* 查看游客基本信息 */
	@RequestMapping(value = "/memberinfo")
	public String memberInfo(HttpServletRequest request, Model mMember) {

		int iUserID = Integer.parseInt(request.getParameter("UserID"));
		VSysUser db_VSysUser = vSysUserServiceImpl.findByiUserID(iUserID).get(0);
		mMember.addAttribute("newVSysUSer", db_VSysUser);
		List<VSysAddress> db_VSysAddress = vSysAddressServiceImpl.findAllByID(iUserID);
		mMember.addAttribute("newVSysAddress", db_VSysAddress);
		return "webbackground/membermanagement/memberinfo";
	}

	/* 查看用户基本信息 */
	@RequestMapping(value = "/staffinfo")
	public String staffInfo(HttpServletRequest request, Model mMember) {

		int iUserID = Integer.parseInt(request.getParameter("UserID"));
		VSysUser db_VSysUser = vSysUserServiceImpl.findByiUserID(iUserID).get(0);
		mMember.addAttribute("newVSysUSer", db_VSysUser);

		return "webbackground/staffmanagement/staffinfo";
	}

	
}
